<%-------------------------------------------------------------------
 * 页面名称：select_bankAccount.jsp
 * 功能描述：选择银行信息弹出页面
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.Constant" %>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
    String path = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/font.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<%=path%>/js/vnv/commonForManage.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script language="JavaScript">
function closePage(){
    window.parent.closeLayer();
}
function submitDatas(obj)
{
    var result=new Array();
    var theTrRadio=obj.getElementsByTagName("INPUT");
    if (theTrRadio[0].tagName!=null&&(theTrRadio[0].type=="radio"||theTrRadio[0].type=="checkbox")) {
        result[0] = theTrRadio[0].peerAccountId;
        result[1] = theTrRadio[0].creditBankId;
        result[2] = theTrRadio[0].creditAccountNo;
        result[3] = theTrRadio[0].creditProvinceId;
        result[4] = theTrRadio[0].creditCityId;
        result[5] = theTrRadio[0].creditBankName;
        result[6] = theTrRadio[0].creditName;
        result[7] = theTrRadio[0].creditEmail;
        result[8] = theTrRadio[0].creditMobile;
        result[9] = theTrRadio[0].creditFixedTel;
        window.parent.closeLayer(result,"email");
        return;
    }
    alert("请选择一条记录!");
}
 
function setCheck(obj) {    //
    var theTrRadio=obj.getElementsByTagName("INPUT");
    if (theTrRadio[0].tagName!=null&&(theTrRadio[0].type=="radio"||theTrRadio[0].type=="checkbox")) {
        theTrRadio[0].click();
    }
}

function submitDatas()
{
    var result=new Array();
    var stack=getRadioGroup("client_info");
    for(var i=0;i<stack.length;i++)
    {
        if(stack[i].checked)
        {
            result[0] = stack[i].peerAccountId;
            result[1] = stack[i].creditBankId;
            result[2] = stack[i].creditAccountNo;
            result[3] = stack[i].creditProvinceId;
            result[4] = stack[i].creditCityId;
            result[5] = stack[i].creditBankName;
            result[6] = stack[i].creditName;
            result[7] = stack[i].creditEmail;
            result[8] = stack[i].creditMobile;
            result[9] = stack[i].creditFixedTel;
            window.parent.closeLayer(result,"email");
            return;
        }
    }
    alert("请选择一条记录!");
}
</script>
<div class="edit_pass">
<form action="<%=path%>/page/common/selectBankAccount.do">
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td>
<table border="0" cellpadding="5" cellspacing="1" >
  <tr>
    <td bgcolor="#FFFFFF">
    <table width="100%" >
      <tr>
        <th height="25" bgcolor="#BFDBF3">&nbsp;</td>
        <th height="25" bgcolor="#BFDBF3">姓名</td>
        <th height="25" bgcolor="#BFDBF3">银行名称</td>
        <th height="25" bgcolor="#BFDBF3">开户行名称</td>
        <th height="25" bgcolor="#BFDBF3">银行账号</td>
        <th height="25" bgcolor="#BFDBF3">列表类别</td>
      </tr>
      <c:forEach var="peerBankAccount" items="${list.data}" varStatus="status">
      <c:if test="${status.index % 2 == 0}"><tr height="28" onDblClick="submitDatas(this)" onClick="setCheck(this)" align="center" class="tableWhiteBg"></c:if>
      <c:if test="${status.index % 2 == 1}"><tr height="28" onDblClick="submitDatas(this)" onClick="setCheck(this)" align="center" class="tableBlueBg"></c:if>
        <td bgcolor="#F0F9FE" nowrap>
            <input type="radio" name="client_info" style="border:0" 
              peerAccountId='<bean:write name="peerBankAccount" property="id"/>' 
              creditBankId='<bean:write name="peerBankAccount" property="bank.id"/>' 
              creditAccountNo='<bean:write name="peerBankAccount" property="cardNo"/>' 
              creditProvinceId='<bean:write name="peerBankAccount" property="province.cityId"/>' 
              creditCityId='<bean:write name="peerBankAccount" property="city.cityId"/>' 
              creditBankName='<bean:write name="peerBankAccount" property="bankName"/>' 
              creditName='<bean:write name="peerBankAccount" property="peerName"/>' 
              creditEmail='<bean:write name="peerBankAccount" property="peerEmail"/>' 
              creditMobile='<bean:write name="peerBankAccount" property="peerMobile"/>' 
              creditFixedTel='<bean:write name="peerBankAccount" property="peerPhone"/>' />
        </td>
        <td bgcolor="#F0F9FE" nowrap><bean:write name="peerBankAccount" property="peerName"/></td>
        <td bgcolor="#F0F9FE" nowrap><bean:write name="peerBankAccount" property="bank.bankName"/></td>
        <td bgcolor="#F0F9FE" nowrap><bean:write name="peerBankAccount" property="bankName"/></td>
        <td bgcolor="#F0F9FE" nowrap><bean:write name="peerBankAccount" property="cardNo"/></td>
        <td bgcolor="#F0F9FE" nowrap>
            <logic:equal name="peerBankAccount" property="source" value="<%=Constant.PEER_ACCOUNT_SOURCE_PREPARATIVE%>">联系人</logic:equal>
            <logic:equal name="peerBankAccount" property="source" value="<%=Constant.PEER_ACCOUNT_SOURCE_TRANSACTED%>">交易过账户</logic:equal>
        </td>
      </tr>
      </c:forEach>
    </table>
		  <table width="100%">
      <tr height="25">
        <td colspan="6" bgcolor="#FFFFFF">
        <ad:PageBean name="list"></ad:PageBean>
        </td>
      </tr>
	  </table>
    </td>
  </tr>
</table>
</td></tr>
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="41" align="center">
        <input type="button" value="确定" class="button_style" onclick="submitDatas();" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" value="取消" class="button_style" onclick="closePage();" />
    </td>
  </tr>
</table>
</td></tr>
</table>
</form>
</div>
<script type="text/javascript">
window.parent.showLayer(window);
</script>